﻿<%@ Page Title="" Language="C#" MasterPageFile="~/design_page/admin/admin.master"
AutoEventWireup="true" CodeFile="admin_class_show_all.aspx.cs" Inherits="design_page_admin_Default"
%>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
    Runat="Server">
        <div style="text-align: center; margin-right: auto; margin-left: auto; height: 166px;">
            <div style="text-align: center; margin-right: auto; margin-left: auto; width: 972px;">
                <table cellpadding="0" cellspacing="11" class="style19" style="width: 961px">
                    <tr>
                        <td>
                        <div>
                        <asp:GridView ID="GridView_main" runat="server" CellPadding="4" ForeColor="#333333"
                            DataKeyNames="_Cid" GridLines="None" AutoGenerateColumns="False" 
                                onrowediting="gridview_main_editing" 
                                onrowupdating="gridView_main_Update" 
                                onrowcancelingedit="gridview_main_cancel" 
                                onselectedindexchanging="gridview_main_select" Width="892px" 
                                AllowPaging="True" onpageindexchanging="gridview_main_pageindexchanging" 
                                PageSize="15">
                                <Columns>
                                    <asp:TemplateField HeaderText="选择">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="CheckBox" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="班级ID">
                                        <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("_Cid") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="班级名称">
                                        <ItemTemplate>
                                           <asp:Label ID="Label2" runat="server" Text='<%# Bind("_Cname") %>'></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="id_classname" runat="server" Text='<%# Eval("_Cname") %>'>
                                            </asp:TextBox>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="教师ID">
                                        <ItemTemplate>
                                             <asp:Label ID="Label3" runat="server" Text='<%# Bind("_Tid") %>'></asp:Label>
                                        </ItemTemplate> 
                                        <EditItemTemplate>
                                           <asp:DropDownList ID="id_teacherid" runat="server"  
                                                DataSourceID="SqlDataSource1" 
                                                DataTextField="column1" DataValueField="column1" 
                                                SelectedValue='<%# Bind("_Tid") %>' AutoPostBack="True" 
                                                onselectedindexchanged="id_teacherid_SelectedIndexChanged"> 
                                           </asp:DropDownList>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="教师名称">
                                        <ItemTemplate>
                                           <asp:Label ID="Label4" runat="server" Text='<%# Bind("_Tname") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField SelectText="详细" ShowSelectButton="True" />
                                    <asp:TemplateField HeaderText="">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="Button5" runat="server" Text="编辑" CommandName="edit"
                                            />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:LinkButton ID="Button6" runat="server" Text="更新" CommandName="Update"
                                            />
                                            <asp:LinkButton ID="cancel" runat="server" Text="取消" CommandName="Cancel"
                                            />
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <AlternatingRowStyle BackColor="White" />
                                <EditRowStyle BackColor="#2461BF" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center"
                                />
                                <RowStyle BackColor="#EFF3FB" />
                                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333"
                                />
                                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                <SortedDescendingHeaderStyle BackColor="#4870BE" />
                            </asp:GridView>
                            <asp:GridView ID="GridView_detail" runat="server" CellPadding="4" ForeColor="#333333"
                            GridLines="None" onselectedindexchanging="gridview_detail_select"
                            DataKeyNames="_Sid" AutoGenerateColumns="False" width="938px" 
                                AllowPaging="True" onpageindexchanging="gridview_detail_pageindexchanging" 
                                PageSize="15">
                                <Columns>
                                    <asp:TemplateField HeaderText="选择">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="CheckBox" runat="server" width="60px" />
                                        </ItemTemplate>
                                    </asp:TemplateField>


                                     <asp:TemplateField HeaderText="学生ID">
                                        <ItemTemplate>
                                    <asp:Label ID="dLabel_studentid" runat="server" Text='<%# Bind("_Sid") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                      <asp:TemplateField HeaderText="学生姓名">
                                        <ItemTemplate>
                                    <asp:Label ID="dLabel7" runat="server" width="80px" Text='<%# Bind("_Sname") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                      <asp:TemplateField HeaderText="学生性别">
                                        <ItemTemplate>
                                    <asp:Label ID="dLabel8" runat="server" width="80px" Text='<%# Bind("_Ssex") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>


                                      <asp:TemplateField HeaderText="学生电话">
                                        <ItemTemplate>
                                    <asp:Label ID="dLabel9" runat="server" Text='<%# Bind("_Sphone") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                      <asp:TemplateField HeaderText="班级ID">
                                        <ItemTemplate>
                                    <asp:Label ID="dLabel_classid" runat="server" width="80px" Text='<%# Bind("_Cid") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                      <asp:TemplateField HeaderText="班级名称">
                                        <ItemTemplate>
                                    <asp:Label ID="dLabel2" runat="server" width="80px" Text='<%# Bind("_Cname") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                      <asp:TemplateField HeaderText="教师ID">
                                        <ItemTemplate>
                                    <asp:Label ID="dLabel3" runat="server" Text='<%# Bind("_Tid") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                      <asp:TemplateField HeaderText="教师名称">
                                        <ItemTemplate>
                                    <asp:Label ID="dLabel4" runat="server" width="80px" Text='<%# Bind("_Tname") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                      <asp:TemplateField HeaderText="教师性别">
                                        <ItemTemplate>
                                    <asp:Label ID="dLabel5" runat="server" width="80px" Text='<%# Bind("_Tsex") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                      <asp:TemplateField HeaderText="教师电话">
                                        <ItemTemplate>
                                    <asp:Label ID="dLabel6" runat="server" Text='<%# Bind("_Tphone") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                     







                                </Columns>
                                <AlternatingRowStyle BackColor="White" />
                                <EditRowStyle BackColor="#2461BF" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center"
                                />
                                <RowStyle BackColor="#EFF3FB" />
                                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333"
                                />
                                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                <SortedDescendingHeaderStyle BackColor="#4870BE" />
                            </asp:GridView>
                           
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                ConflictDetection="CompareAllValues" 
                                ConnectionString="<%$ ConnectionStrings:mei_design_5.2 %>" 
                                DeleteCommand="DELETE FROM [_teacher] WHERE [_Tid] = @original_column1" 
                                InsertCommand="INSERT INTO [_teacher] ([_Tid]) VALUES (@column1)" 
                                OldValuesParameterFormatString="original_{0}" 
                                SelectCommand="SELECT [_Tid] AS column1 FROM [_teacher]">
                                <DeleteParameters>
                                    <asp:Parameter Name="original_column1" Type="String" />
                                </DeleteParameters>
                                <InsertParameters>
                                    <asp:Parameter Name="column1" Type="String" />
                                </InsertParameters>
                            </asp:SqlDataSource>
                        </div>
                            
                            
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:CheckBox ID="CheckBox1" runat="server" Text="全选" Width="80px" 
                                AutoPostBack="True" oncheckedchanged="checkbos_all_checkedchanged"
                            />
                            <asp:CheckBox ID="CheckBox2" runat="server" Text="反选" Width="80px" 
                                AutoPostBack="True" oncheckedchanged="checkbos_Invert_checkedchanged"
                            />
                            <asp:Button ID="Button1" runat="server" Text="删除" onclick="Button1_Click" />
                            <asp:Button ID="Button4" runat="server" Text="返回" onclick="Button4_Click" 
                                Visible="False" />
                            <asp:Button ID="Button2" runat="server" Text="显示全部班级信息" onclick="Button5_Click" 
                                Visible="False" />

                             <asp:Label ID="frist_teacherid" runat="server" Text="Label" Visible="False"></asp:Label>
                             <asp:Label ID="detail_classid" runat="server" Text="Label" Visible="False"></asp:Label>
                              <asp:Label ID="detail_teacherid" runat="server" Text="Label" Visible="False"></asp:Label>
                            <asp:Label ID="static_Is_in_maingridview" runat="server" Text="当前是主表" Visible="False"> </asp:Label>
                            
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label5" runat="server" Text="Label" Visible="False"></asp:Label>
                            
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </asp:Content>